# 下載 xv6-riscv 源碼
Write-Host "正在下載 xv6-riscv 源碼..." -ForegroundColor Cyan

if (!(Test-Path "xv6-riscv")) {
    try {
        git clone https://github.com/mit-pdos/xv6-riscv.git
        Write-Host "xv6-riscv 下載完成" -ForegroundColor Green
    } catch {
        Write-Host "xv6-riscv 下載失敗: $($_.Exception.Message)" -ForegroundColor Red
        Write-Host "請手動訪問 https://github.com/mit-pdos/xv6-riscv 下載源碼" -ForegroundColor Yellow
    }
} else {
    Write-Host "xv6-riscv 已存在" -ForegroundColor Yellow
}

Write-Host "下載完成！" -ForegroundColor Green
